<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:template match="/">
		<infopost-request>
			<xsl:for-each select="ABCB2I">
				<request-head>
					<xsl:for-each select="Header">
						<trans-id>
							<xsl:value-of select="SerialNo" />
						</trans-id>
						<trans-date>
							<xsl:value-of select="TransDate" />
						</trans-date>
						<trans-time>
							<xsl:value-of select="TransTime" />
						</trans-time>
						<bank>203</bank>
						<insu-id>
							<xsl:value-of select="CorpNo" />
						</insu-id>
						<trans-type>201</trans-type>
						<area>
							<xsl:value-of select="ProvCode" />
						</area>
						<branch />
						<post>
							<xsl:value-of select="BranchNo" />
						</post>
						<agency-hand>
							<xsl:value-of select="Tlid" />
						</agency-hand>
						<xsl:call-template name="sourceTypeCode">
							<xsl:with-param name="srcCode" select="EntrustWay" />
						</xsl:call-template>
						<authorized />
					</xsl:for-each>
				</request-head>
				<xsl:for-each select="App">
					<xsl:for-each select="Req">
						<request-intraday-cancel>
							<related-trans-id>
								<xsl:value-of select="OrgSerialNo" />
							</related-trans-id>
							<policy-code>
								<xsl:value-of select="PolicyNo" />
							</policy-code>
							<premium>
								<xsl:value-of select="PayAmt" />
							</premium>
						</request-intraday-cancel>
					</xsl:for-each>
				</xsl:for-each>
			</xsl:for-each>
		</infopost-request>
	</xsl:template>
	<xsl:template name="sourceTypeCode">
		<xsl:param name="srcCode" />
		<xsl:choose>
			<xsl:when test="$srcCode = '01'">
				<source-type>1</source-type>
			</xsl:when>
			<xsl:otherwise>
				<source-type>
					<xsl:value-of select="$srcCode" />
				</source-type>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
